package com.yiwyn.demo.listener;

import com.yiwyn.demo.event.TestEvent;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class TestListener {


    @EventListener(classes = {TestEvent.class})
    public void onTestEvent(TestEvent testEvent) {
        log.info("事件消费:{}", testEvent.getResult());
    }

}
